#include "progresswindow.h"

#include <QtGui>

ProgressWindow::ProgressWindow ()
{
    QVBoxLayout *mainlayout = new QVBoxLayout;
    title = new QLabel("Action is in progress...");

    progressBar = new QProgressBar;
    progressBar->setMaximum(100);
    progressBar->setValue(0);

    mainlayout->addWidget(title);
    mainlayout->addWidget(progressBar);

    this->setLayout(mainlayout);
}

ProgressWindow::ProgressWindow (QString titleText)
{
    QVBoxLayout *mainlayout = new QVBoxLayout;
    title = new QLabel(titleText);

    progressBar = new QProgressBar;
    progressBar->setMaximum(100);
    progressBar->setValue(0);

    mainlayout->addWidget(title);
    mainlayout->addWidget(progressBar);

    this->setLayout(mainlayout);
}



ProgressWindow::ProgressWindow (QString titleText, int max)
{
    QVBoxLayout *mainlayout = new QVBoxLayout;
    title = new QLabel(titleText);

    progressBar = new QProgressBar;
    progressBar->setMaximum(max);
    progressBar->setValue(0);

    mainlayout->addWidget(title);
    mainlayout->addWidget(progressBar);

    this->setLayout(mainlayout);
}

void ProgressWindow::setPosition(int pos)
{
    this->progressBar->setValue(pos);
}

int ProgressWindow::getPosition()
{
    return this->progressBar->value();
}

void ProgressWindow::setMaximum(int max)
{
    this->progressBar->setMaximum(max);
}

int ProgressWindow::getMaximum()
{
    return progressBar->maximum();
}
